import { legacy_createStore, combineReducers, compose, applyMiddleware } from 'redux'
import { thunk } from 'redux-thunk'
import handleUser from './user-status/reducer'
import handleBaseUer from './base-url-status/reducer'

const reducers = combineReducers({
  handleUser,
  handleBaseUer
})

// 判断有没有__REDUX_DEVTOOLS_EXTENSION_COMPOSE__这个模块
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose //rt

const store = legacy_createStore(reducers, composeEnhancers(applyMiddleware(thunk)))
export default store
